<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="css/login.css" rel="stylesheet" />
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="js/login.js"></script>
    <script src="js/layer/layer.js"></script>
    <title>注册_设置密码</title>
    <style>
        #bt2,
        #bt4,
        #bt6,
        #bt8 {
            display: none;
        }
    </style>

</head>

<body>
    <div id="login">
        <div id="header">
            <img class="back" src="images/back.png" alt="">
        </div>
        <div id="content">
            <div id="fp">
                <strong>设置密码</strong>
            </div>
            <div id="code">
                <img src="images/icon.png" alt="">
                <span>两次输入登录密码必须相同</span>
            </div>
            <form action="" id="form">
                <input type="password" placeholder="请输入登录密码" id="ps1">
                <img src="images/close.png" alt="" id="bt1" class="img1">
                <img src="images/open.png" alt="" id="bt2" class="img1">
                <input type="password" placeholder="请再次输入登录密码" id="ps2">
                <img src="images/close.png" alt="" id="bt3" class="img2">
                <img src="images/open.png" alt="" id="bt4" class="img2">
                <input type="text" placeholder="请再次输入推荐码（选填）" id="bt5">
            </form>
            <div id="button">
                <button class="login">下一步</button>
            </div>
        </div>
        <div id="bottom">
            <strong>已有云网账号？
                <a href="login.html" id="zhuce">登录</a>
            </strong>
        </div>

    </div>

    <script>
        // console.log(localStorage.invite_code);

        $(function () {

            if (localStorage.invite_code) {
                $("#bt5").val(localStorage.invite_code);
                $('#bt5').attr("disabled", "disabled")
                // }else {

            }

            $(".back").click(function () {
                $(window).attr('location', "register_VertificationCode.html");
            });



            $(".login").click(function () {
                if (localStorage.flag == "true") {
                    localStorage.password = $("#ps1").val();
                    localStorage.password1 = $("#ps2").val();
                    console.log(localStorage.password);
                    console.log(localStorage.password1);
                    // console.log($("#ps1").val());

                    if (localStorage.password === '' || localStorage.password1 === '') {
                        // alert("密码不能为空")
                        layer.msg("密码不能为空");
                    } else {
                        if (localStorage.password === localStorage.password1) {
                            $(window).attr('location', "register_nicknameSet.html");

                        } else {
                            // alert("请输入一样的密码");
                            layer.msg("请输入一样的密码");
                        }
                    }

                }else{
                    layer.msg("请验证手机号")
                }
            });
        })
    </script>

    <script>
        $(function () {
            $("#form .img1").click(function () {
                if ($("#ps1").attr("type") == "text") {
                    $("#ps1").attr("type", "password");
                    $('#bt1').show();
                    $("#bt2").hide();
                } else {
                    $("#ps1").attr("type", "text");
                    $('#bt1').hide();
                    $("#bt2").show();
                }
            });
        })
    </script>
    <script>
        $(function () {
            $("#form .img2").click(function () {
                if ($("#ps2").attr("type") == "text") {
                    $("#ps2").attr("type", "password");
                    $('#bt3').show();
                    $("#bt4").hide();
                } else {
                    $("#ps2").attr("type", "text");
                    $('#bt3').hide();
                    $("#bt4").show();
                }
            });
        })
    </script>
</body>

</html>